package com.hhc;


public class T {

    public static void main(String[] args) {
        tableSizeFor(17);
    }

    // 17  100000
    public static int tableSizeFor(int initialCapacity) {
        int capacity = 1;
        while (capacity < initialCapacity)
            capacity <<= 1;
        System.out.println(capacity);
        return capacity;
    }

    // 数组遍历
    void test1(int arr[]){
        for(int i=0;i<arr.length;i++){}
    }

    class ListNode{
        int val;
        ListNode next;
    }
    // 链表遍历1(迭代)
    void test2(ListNode head){
        for(ListNode p = head;p != null;p=p.next){}
    }
    // 链表遍历2(递归)
    void test3(ListNode head){
        test3(head.next);
    }

    // 二叉树遍历
    class TreeNode{
        int val;
        TreeNode left,right;
    }
    void test4(TreeNode root){
        test4(root.left);
        test4(root.right);
    }

    // N叉树遍历
    class Treenode1{
        int val;
        Treenode1[] children;
    }
    void test5(Treenode1 root){
        for(Treenode1 child:root.children){
            test5(child);
        }
    }

    // 图 是好几个N叉树的集合体
}
